package com.gdssoft.pdaweb.service.am.impl;
/*
 *  捷达世软件（深圳）有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
*/
import java.util.List;

import com.gdssoft.core.service.impl.BaseServiceImpl;
import com.gdssoft.framework.model.system.AppUser;
import com.gdssoft.pdaweb.dao.am.PdaAmMeterDao;
import com.gdssoft.pdaweb.model.am.PdaAmMeter;
import com.gdssoft.pdaweb.service.am.PdaAmMeterService;

public class PdaAmMeterServiceImpl extends BaseServiceImpl<PdaAmMeter> implements PdaAmMeterService{
	private PdaAmMeterDao dao;
	
	public PdaAmMeterServiceImpl(PdaAmMeterDao dao) {
		super(dao);
		this.dao=dao;
	}

	@Override
	public PdaAmMeter getByAmId(String amId) {
		return dao.getByAmId(amId);
	}

	@Override
	public List<PdaAmMeter> getAllForExcel() {
		return dao.getAllForExcel();
	}
	
	@Override
	public List<PdaAmMeter> getAmExcel(String idS) {
		return dao.getAmExcel(idS);
	}
	
	@Override
	public boolean isExist(String amId) {
		return dao.getByAmId(amId).getAmId()==null?false:true;
	}

	@Override
	public List<PdaAmMeter> getAm(String districtId,String buildingId) {		
		return dao.getByPosition(districtId,buildingId);
	}
	
	@Override
	public boolean isCrmMeterNoExist(String crmMeterNo) {
		return dao.isCrmMeterNoExist(crmMeterNo);
	}

	@Override
	public boolean pauseAndResume(String recId, String vType, AppUser appUser,String dateT) {
		// TODO Auto-generated method stub
		if(vType.equals("2")){
			vType="4";
		}else{
			vType="2";
		}
		return dao.pauseAndResume(recId, vType, appUser, dateT);
	}
}